package com.imooc.trading_system.exception;

import com.imooc.trading_system.enums.BizCodeEnum;
import lombok.Data;

/**
 * @author Feng zhaoxi
 * @version 1.0
 * @date 2021/12/29 1:47 下午
 */
@Data
public class BizException extends RuntimeException {
    private Integer code;
    private String msg;

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }

    public BizException(BizCodeEnum bizCodeEnum) {
        super(bizCodeEnum.getMsg());
        this.code = bizCodeEnum.getCode();
        this.msg = bizCodeEnum.getMsg();
    }
}
